package com.faithbj.dao.impl;

import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.faithbj.common.dao.impl.BaseDaoImpl;
import com.faithbj.common.model.fm.FamilyMemberIncome;
import com.faithbj.dao.FamilyMemberIncomeDao;

@Repository("familyMemberIncomeDao")
public class FamilyMemberIncomeDaoImpl extends
		BaseDaoImpl<FamilyMemberIncome, String> implements
		FamilyMemberIncomeDao {

	@Override
	public FamilyMemberIncome getFamilyMemberIncomeByFmId(String fmId) {
		Session session = this.getSession();
		return (FamilyMemberIncome) session.createCriteria(FamilyMemberIncome.class)
				.add(Restrictions.eq("fmId", fmId)).uniqueResult();
	}

}
